
import { hiprint } from 'vue-plugin-hiprint';
import logoImg from '/@/assets/logo.png';
// 自定义设计元素2
export const TestProvider = function (t:Function) {
 
	var addElementTypes = function (context: any) {
		context.removePrintElementTypes('TestProvider');
		context.addPrintElementTypes('TestProvider', [
			new hiprint.PrintElementTypeGroup(t('message.printTemp.publicCom'), [/* '【公共组件】' */
				{
					tid: 'aProviderModule.barcode',
					title: t('message.printTemp.barCode'),
					data: '18020030720',
					type: 'text',
					options: {
						field: 'barCode',
						testData: 'ZUO18020030720',
						height: 32,
						fontSize: 12,
						lineHeight: 18,
						fontWeight: '700',
						textAlign: 'left',
						textContentVerticalAlign: 'middle',
						textType: 'barcode',
					},
				},
				{
					tid: 'aProviderModule.qrcode',
					title: t('message.printTemp.qrCode'),
					data: 'ZUO18020030720',
					type: 'text',
					options: {
						field: 'qrCode',
						testData: 'ZUO18020030720',
						height: 64,
						width: 64,
						fontSize: 12,
						lineHeight: 18,
						fontWeight: '700',
						textAlign: 'left',
						textContentVerticalAlign: 'middle',
						textType: 'qrcode',
					},
				},
				{
					tid: 'aProviderModule.table',
					title: t('message.printTemp.table'),
					type: 'table',
					options: {
						field: 'table',
						tableHeaderRepeat: 'first',
						tableFooterRepeat: 'last',
						fields: [
							{ text: t('message.printTemp.name'), field: 'NAME' },
							{ text: t('message.printTemp.qty'), field: 'SL' },
							{ text: t('message.printTemp.spec'), field: 'GG' },
							{ text: t('message.printTemp.code'), field: 'TM' },
							{ text: t('message.printTemp.price'), field: 'DJ' },
							{ text: t('message.printTemp.amount'), field: 'JE' },
						],
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: false,
					columns: [
						[
							{ title: t('message.printTemp.name'), align: 'center', field: 'NAME', width: 150 },
							{ title: t('message.printTemp.qty'), align: 'center', field: 'SL', width: 80 },
							{ title: t('message.printTemp.spec'), align: 'center', field: 'GG', width: 80, checked: false },
							{ title: t('message.printTemp.code'), align: 'center', field: 'TM', width: 100, checked: false },
							{ title:t('message.printTemp.price'), align: 'center', field: 'DJ', width: 100 },
							{ title: t('message.printTemp.amount'), align: 'center', field: 'JE', width: 100, checked: false },
						],
					],
					// footerFormatter: function (options: unknown, rows: unknown, data: any, currentPageGridRowsData: unknown) {
					//   if (data && data['totalCap']) {
					//     return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
					//   }
					//   return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
					// },
				},
				{
					tid: 'aProviderModule.customText',
					title: t('message.printTemp.text'),
					customText: t('message.printTemp.customText'),
					custom: true,
					type: 'text',
					options: {
						width: 200,
						testData: t('message.printTemp.longText'),
					},
				},
				{ tid: 'aProviderModule.logo', title: 'Logo',  type: 'image', options: { field: 'https://inews.gtimg.com/om_bt/OVx3YS2XJc1zbndGTkjPKW9J0W7kN8M0SIidT-3K4mb2YAA/641' } },
								
				{
					tid: 'aProviderModule.longText',
					title: t('message.printTemp.long'),
					type: 'longText',
					options: {
						field: 'test.longText',
						width: 200,
						testData: t('message.printTemp.longText'),
					},
				},
				{ tid: 'aProviderModule.hline', title: t('message.printTemp.line'), type: 'hline' },
				{ tid: 'aProviderModule.vline', title: t('message.printTemp.horizontalLine'), type: 'vline' },
				{ tid: 'aProviderModule.rect', title: t('message.printTemp.rectangle'), type: 'rect' },
				{ tid: 'aProviderModule.oval', title: t('message.printTemp.ellipse'), type: 'oval' },
			]),
			new hiprint.PrintElementTypeGroup(t('message.printTemp.tableHeader'), [
				{
					tid: 'orderinfo.operationName',
					title: t('message.printTemp.orderName'),
					data: 'operationName',
					type: 'text',
					options: {
						field: 'orderinfo.operationName',
						testData: 'OP_01',
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: true,
					},
				},
				{
					tid: 'orderinfo.userName',
					title: t('message.printTemp.operator'),
					data: 'userName',
					type: 'text',
					options: {
						field: 'orderinfo.userName',
						testData: t('message.printTemp.zs'),
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: true,
					},
				},
				{
					tid: 'orderinfo.startTime',
					title: t('message.printTemp.startDate'),
					data: 'startTime',
					type: 'text',
					options: {
						field: 'orderinfo.startTime',
						testData: '2024-01-01 20:22:22',
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: true,
					},
				},
				{
					tid: 'orderinfo.entTime',
					title: t('message.printTemp.endDate'),
					data: 'entTime',
					type: 'text',
					options: {
						field: 'orderinfo.entTime',
						testData: '2024-01-01 22:22:22',
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: true,
					},
				},
				{
					tid: 'orderinfo.recipeName',
					title: t('message.printTemp.recipeName'),
					data: 'recipeName',
					type: 'text',
					options: {
						field: 'orderinfo.recipeName',
						testData: 'rec01',
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: false,
					},

				},
				{
					tid: 'orderinfo.productName',
					title: t('message.printTemp.productName'),
					data: 'productName',
					type: 'text',
					options: {
						field: 'orderinfo.productName',
						testData: 'product01',
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: false,
					},
				},
				{
					tid: 'orderinfo.batchName',
					title: t('message.printTemp.batchName'),
					data: t('message.printTemp.name1'),
					type: 'text',
					options: {
						field: 'orderinfo.batchName',
						testData: 'batch01',
						height: 17,
						fontSize: 16.5,
						fontWeight: '700',
						textAlign: 'center',
						hideTitle: false,
					},
				},
			]),
			new hiprint.PrintElementTypeGroup(t('message.printTemp.report'), [
				{
					tid: 'testTable.echart',
					title: t('message.printTemp.echarts'),
					type: "html",
					options: {
						left: 100,
						top: 100,
						height: 100,
						width: 100,
						formatter: "function(t, e, printData) {\n                var script = document.createElement(\"script\");\n                script.setAttribute(\"type\", \"text/javascript\");\n                script.setAttribute(\"src\", \"/src/assets/echarts.min.js\");\n                return script;\n            }"
					}
				},
				{
					tid: 'order',
					title: t('message.printTemp.pointChart'),
					type: "html",

					autobreak: true,
					//fontWeight: 'b',
					options: {
						left: 12,
						top: 12,
						height: 200,
						//xdata:['one1','one3','one4','one6','one9'],
						width: 200,
						fontWeight: 'red',
						textAlign: 'line',
						aaa: '10',
						//formatter: "function(t, e, printData) {                if (window.echarts) {                    var echartDom = document.createElement(\"div\");                    echartDom.style.width = e.width+'px';                    echartDom.style.height =e.height+'px';                    var echartInstance = echarts.init(echartDom,null,{renderer: \"svg\"});                    echartInstance.setOption({                        animation: false,                        grid: {                            top: 10,                            right: e.aaa,                            bottom: 20,                            left: 30,                        },                        xAxis: {                            type: 'category',                            data:printData?.xlineData||  ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']                        },                        yAxis: {                            type: 'value'                        },               color:[e.fontWeight]  ,       series: [                            {                                data: printData?.lineData || [150, 230, 224, 218, 135, 147, 260],                                type: e.textAlign , markLine:{	data:[{yAxis:e.aaa,type:'average'}],	label:{normal:{formatter:'最大值'}}	  }                             }                        ]                    });               return echartDom;                } else {                    return '<div style=\"width: 267px;height: 267px; border: 1px solid;\">请先拖拽Echarts依赖</div>'                }            }"
						formatter: "function(t, e, printData) {console.log(printData);if (window.echarts) {var echartDom = document.createElement(\"div\");echartDom.style.width = e.width+'px';echartDom.style.height =e.height+'px';var echartInstance = echarts.init(echartDom,null,{renderer: \"svg\"});echartInstance.setOption({title: {text: 'TEST'},legend: {data: printData?.xlineData || ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'] ,},animation: false,grid: {top: 10,right: e.aaa,bottom: 20,left: 30,},xAxis: {type: 'category',data:printData?.xlineData||  ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun'],boundaryGap: false,axisTick: {alignWithLabel: true,},splitLine: {show: true,lineStyle: {color: '#ccc',type: 'dashed'}}},yAxis: [{{type: 'value',name:'Y轴1',position: 'left',alignTicks: true,offset: 0,nameTextStyle: {fontSize: 14,fontWeight: 'bold',},min: 0,max: 30,scale: true,axisLabel: {formatter: function (value) {return value.toFixed(2);},},axisLine: {show: true,lineStyle: {color: '#5470C6'}},},{type: 'value',name:'Y轴2',position: 'right',alignTicks: true,offset: 0,nameTextStyle: {fontSize: 14,fontWeight: 'bold',},min: 0,max: 50,scale: true,axisLabel: {formatter: function (value) {return value.toFixed(2);},},axisLine: {show: true,lineStyle: {color: '#91CC75'}},},{type: 'value',name:'Y轴3',position: 'right',alignTicks: true,offset: 60,nameTextStyle: {fontSize: 14,fontWeight: 'bold',},min: 0,max: 80,scale: true,axisLabel: {formatter: function (value) {return value.toFixed(2);}},axisLine: {show: true,lineStyle: {color: '#5100C3'}}},{type: 'value',name:'Y轴4',position: 'right',alignTicks: true,offset: 120,nameTextStyle: {fontSize: 14,fontWeight: 'bold'},min: 0,max: 100,scale: true,axisLabel: {formatter: function (value) {return value.toFixed(2);},},axisLine: {show: true,lineStyle: {color: '#100C75'}}}}],color:[e.fontWeight] ,series: [{data: printData?.lineData || [150, 230, 224, 218, 135, 147, 260],type: e.textAlign , markLine:{	data:[{yAxis:e.aaa,type:'average'}],label:{normal:{formatter:'最大值'}}	} }]});return echartDom;} else {return '<div style=\"width: 267px;height: 267px; border: 1px solid;\">请先拖拽Echarts依赖</div>'}}"
					
					}

				},
				{
					tid: 'echatsinfo',
					title: t('message.printTemp.pointChartNew'),
					type: "html",

					autobreak: true,
					//fontWeight: 'b',
					options: {
						left: 12,
						top: 12,
						height: 300,
						//xdata:['one1','one3','one4','one6','one9'],
						width: 750,
						fontWeight: 'red',
						textAlign: 'line',
						aaa: '10',
						//formatter: "function(t, e, printData) {                if (window.echarts) {                    var echartDom = document.createElement(\"div\");                    echartDom.style.width = e.width+'px';                    echartDom.style.height =e.height+'px';                    var echartInstance = echarts.init(echartDom,null,{renderer: \"svg\"});                    echartInstance.setOption({                        animation: false,                        grid: {                            top: 10,                            right: e.aaa,                            bottom: 20,                            left: 30,                        },                        xAxis: {                            type: 'category',                            data:printData?.xlineData||  ['Mon', 'Tue', 'Wed', 'Thu', 'Fri', 'Sat', 'Sun']                        },                        yAxis: {                            type: 'value'                        },               color:[e.fontWeight]  ,       series: [                            {                                data: printData?.lineData || [150, 230, 224, 218, 135, 147, 260],                                type: e.textAlign , markLine:{	data:[{yAxis:e.aaa,type:'average'}],	label:{normal:{formatter:'最大值'}}	  }                             }                        ]                    });               return echartDom;                } else {                    return '<div style=\"width: 267px;height: 267px; border: 1px solid;\">请先拖拽Echarts依赖</div>'                }            }"
						formatter: "function(t,e,printData){if(window.echarts&&printData){console.log(printData.reportObjectTemp);if(!printData.reportObjectTemp){return'<div style=\"width: 750px;height: 300px; border: 1px solid;\">请先拖拽Echarts依赖</div>'}   printData.reportObjectTemp=printData.reportObjectTemp[0];var echartDom=document.createElement(\"div\");echartDom.style.width=e.width+'px';echartDom.style.height=e.height+'px';var echartInstance=echarts.init(echartDom,null,{renderer:\"svg\"});var options={title:{text:printData.reportObjectTemp.reportName,},tooltip:printData.reportObjectTemp.tooltip,legend:{data:printData.reportObjectTemp.legendData,},grid:{show:true,left:'3%',right:'10%',bottom:'3%',containLabel:true,},xAxis:printData.reportObjectTemp.xAxisData,yAxis:printData.reportObjectTemp.yAxisData,series:printData.reportObjectTemp.seriesData,};echartInstance.setOption(options);console.log(echartDom);return echartDom}else{return'<div style=\"width:750px;height: 300px; border: 1px solid;\">请先拖拽Echarts依赖</div>'}}"
					}

				},
				{
					tid: 'testTable.tags',
					title: t('message.printTemp.pointTable'),
					type: 'table',
					options: {
						field: 'pLCTags',
						tableHeaderRepeat: 'first',
						tableFooterRepeat: 'last',
						fields: [
							{ text: t('message.printTemp.time'), field: 'TimeStamp' },
							{ text: t('message.printTemp.point1'), field: 'tag1' },
							{ text: t('message.printTemp.point2'), field: 'tag2' },
							{ text: t('message.printTemp.point3'), field: 'tag3' },
							{ text: t('message.printTemp.point4'), field: 'tag4' },
							{ text: t('message.printTemp.point5'), field: 'tag5' },
						],
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: false,
					columns: [
						[
							{ title: t('message.printTemp.time'), align: 'center', field: 'TimeStamp', width: 150 },
							{ title: t('message.printTemp.point1'), align: 'center', field: 'tag1', width: 80 },
							{ title:  t('message.printTemp.point2'), align: 'center', field: 'tag2', width: 80 },
							{ title: t('message.printTemp.point3'), align: 'center', field: 'tag3', width: 100 },
							{ title:  t('message.printTemp.point4'), align: 'center', field: 'tag4', width: 100 },
							{ title: t('message.printTemp.point5'), align: 'center', field: 'tag5', width: 100 },
						],
					],
					// footerFormatter: function (options: unknown, rows: unknown, data: any, currentPageGridRowsData: unknown) {
					//   if (data && data['totalCap']) {
					//     return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
					//   }
					//   return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
					// },
				},

				{
					tid: 'testTable.pLCAlarmEvents',
					title: t('message.printTemp.alarmInfo'),
					type: 'table',
					options: {
						field: 'pLCAlarmEvents',
						tableHeaderRepeat: 'first',
						tableFooterRepeat: 'last',
						fields: [
							{ text: 'ID', field: 'class' },
							{ text: t('message.printTemp.time'), field: 'dateTime' },
							{ text: t('message.printTemp.alarmText'), field: 'text1' },
							{ text: t('message.printTemp.status'), field: 'state' },
							{ text: t('message.printTemp.type'), field: 'type' },
						],
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: false,
					columns: [
						[
							{ title: 'ID', align: 'center', field: 'class', width: 80 },
							{ title: t('message.printTemp.time'), align: 'center', field: 'dateTime', width: 80 },
							{ title: t('message.printTemp.alarmText'), align: 'center', field: 'text1', width: 150 },
							{ title: t('message.printTemp.status'), align: 'center', field: 'state', width: 100 },
							{ title: t('message.printTemp.type'), align: 'center', field: 'type', width: 100 }, 
						],
					],
					// footerFormatter: function (options: unknown, rows: unknown, data: any, currentPageGridRowsData: unknown) {
					//   if (data && data['totalCap']) {
					//     return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
					//   }
					//   return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
					// },
				},
				{
					tid: 'testTable.pLCEventEvents',
					title: t('message.printTemp.eventInfo'),
					type: 'table',
					options: {
						field: 'pLCEventEvents',
						tableHeaderRepeat: 'first',
						tableFooterRepeat: 'last',
						fields: [
							{ text: 'ID', field: 'class' },
							{ text:  t('message.printTemp.time'), field: 'dateTime' },
							{ text: t('message.printTemp.eventText'), field: 'text1' },
							{ text: t('message.printTemp.status'), field: 'state' },
							{ text: t('message.printTemp.type'), field: 'type' },
						],
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: false,
					columns: [
						[
							{ title: 'ID', align: 'center', field: 'class', width: 80 },
							{ title: t('message.printTemp.time'), align: 'center', field: 'dateTime', width: 80 },
							{ title: t('message.printTemp.eventText'), align: 'center', field: 'text1', width: 150 },
							{ title: t('message.printTemp.status'), align: 'center', field: 'state', width: 100 },
							{ title: t('message.printTemp.type'), align: 'center', field: 'type', width: 100 }, 
						],
					],
					// footerFormatter: function (options: unknown, rows: unknown, data: any, currentPageGridRowsData: unknown) {
					//   if (data && data['totalCap']) {
					//     return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
					//   }
					//   return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
					// },
				},
				{
					tid: 'testTable.pLCOpearetionEvents',
					title: t('message.printTemp.opinfo'),
					type: 'table',
					options: {
						field: 'pLCOpearetionEvents',
						tableHeaderRepeat: 'first',
						tableFooterRepeat: 'last',
						fields: [
							{ text: 'ID', field: 'class' },
							{ text:  t('message.printTemp.time'), field: 'dateTime' },
							{ text: t('message.printTemp.opText'), field: 'text1' },
							{ text: t('message.printTemp.status'), field: 'state' },
							{ text: t('message.printTemp.type'), field: 'type' },
						],
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: false,
					columns: [
						[
							{ title: 'ID', align: 'center', field: 'class', width: 80 },
							{ title:  t('message.printTemp.time'), align: 'center', field: 'dateTime', width: 80 },
							{ title: t('message.printTemp.opText'), align: 'center', field: 'text1', width: 150 },
							{ title: t('message.printTemp.status'), align: 'center', field: 'state', width: 100 },
							{ title: t('message.printTemp.type'), align: 'center', field: 'type', width: 100 }, 
						],
					],
					// footerFormatter: function (options: unknown, rows: unknown, data: any, currentPageGridRowsData: unknown) {
					//   if (data && data['totalCap']) {
					//     return `<td style="padding:0 10px" colspan="100">${'应收金额大写: ' + data['totalCap']}</td>`
					//   }
					//   return '<td style="padding:0 10px" colspan="100">应收金额大写: </td>'
					// },
				},

				// {
				// 	tid: 'testTable.printdata222',
				// 	title: "配方",
				// 	type: "html",
				// 	autobreak:false,
				// 	//fontWeight: 'b',
				// 	options: {
				// 		left: 0,
				// 		top: 12,
				// 		height: 200,
				// 		//xdata:['one1','one3','one4','one6','one9'],
				// 		width: 550,
				// 		formatter: `function(t, e, printData) {
				// 			if (printData == null) {
				// 				return '<div>先预览一下，然后点击确认</div>'
				// 			}

				// 			var  strtemp ="<table style="height:1000px"><tr><td>"
				// 			  strtemp += '<div ><span style="color: blue;">|</span><span> 配方</span></div>';
				// 			for (var i = 0; i <printData.orderinfo.phaseViews.length; i++) {
				// 				strtemp += '<div style="display: block; width: 100%;height:auto; border: 1px solid gray; border-radius: 10px; padding: 5px 10px; margin: 5px 10px;"> <section class="el-container is-vertical"> <header class="el-header" style="--el-header-height: 20px; font-size: 14px; font-weight: 700; padding: 0px;"> <span style="background-color: rgba(153, 204, 255, 0.5);"> Step' + (i + 1) + ':' + printData.orderinfo.phaseViews[i].stepName + ' </span> </header>';
				// 				for (var j = 0; j <printData.orderinfo.phaseViews[i].processInfos.length; j++) {
				// 					strtemp += '<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:38:8:el-row" style="font-size: 14px; font-weight: 700; padding: 0px;"> <div class = "el-col el-col-24" vc-path = "src/views/OrderManage/OperationInfo/detail.vue:39:9:el-col" > 				<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:40:10:div" 			class = "grid-content" > 				<span vc-path = "src/views/OrderManage/OperationInfo/detail.vue:41:11:span" 			style = "background-color: rgba(153, 204, 255, 0.5);" > ' + printData.orderinfo.phaseViews[i].processInfos[j].name + ' </span> </div> </div> </div> <div class = "el-row" 			vc-path = "src/views/OrderManage/OperationInfo/detail.vue:45:8:el-row" 			style = "margin-top: 10px; background-color: rgba(204, 204, 255, 0.3);" > ';

				// 					for (var k = 0; k <printData.orderinfo.phaseViews[i].processInfos[j].processparams.length; k++) {
				// 						strtemp += '<div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:46:9:el-col" style="padding: 2px;"> <div class = "el-row"  vc-path = "src/views/OrderManage/OperationInfo/detail.vue:48:10:el-row" 				style = "padding-left: 40px;" > 					<div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:49:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:50:12:div" 				class = "grid-content" > ' + printData.orderinfo.phaseViews[i].processInfos[j].processparams[k].code + ': </div> </div> <div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:52:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:53:12:div" 				class = "grid-content" > ' + printData.orderinfo.phaseViews[i].processInfos[j].processparams[k].name + ' </div> </div> </div> </div>';
				// 					}								 
				// 					strtemp += '</div>';
				// 				}
				// 				strtemp += '</section></div>';
				// 				strtemp+="</td></tr></table>";
				// 			}
				// 			return strtemp;
				// 		}`
				// 	},
				// },
				{
					tid: 'testTable.printdata24',
					title: t('message.printTemp.recipe'),
					field: 'printData.orderinfo.phaseViews',
					type: 'table',
					options: {
						pagebreak: true,
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: false,
					columns: [
						[
							{
								title: t('message.printTemp.recipe'), align: 'center', width: 800, field: 'printData.orderinfo.phaseViews.stepName',
								renderFormatter: `function (value,row,index,options){								
								if(row==null ||  Object.keys(row).length === 0 )
									return '<td></td>'; 
								var strtemp='<td style="width:550pt">'; 
								strtemp += '<div style="display: block; width: 100%;height:auto; border: 1px solid gray; border-radius: 10px; padding: 5px 10px; margin: 5px 10px;position:abolsute;top:0;right:0;bottom:0;left:0;"> <section class="el-container is-vertical"> <header class="el-header" style="--el-header-height: 20px; font-size: 14px; font-weight: 700; padding: 0px;"> ';
								strtemp+='<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:233:7:el-row" style="background-color: rgba(153, 204, 255, 0.5);width:100%"><div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:234:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:235:9:div" class="grid-content">Step' + (index + 1) + ':' + row.stepName + '</div></div></div>';
								strtemp+=' </header>';
								for (var j = 0; j <row.processInfos.length; j++) {
									strtemp += '<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:38:8:el-row" style="font-size: 14px; font-weight: 700; padding: 0px;width:100%"> <div class = "el-col el-col-24" vc-path = "src/views/OrderManage/OperationInfo/detail.vue:39:9:el-col" > 				<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:40:10:div" 			class = "grid-content" > 				<span vc-path = "src/views/OrderManage/OperationInfo/detail.vue:41:11:span" 			style = "background-color: rgba(153, 204, 255, 0.5);" > ' + row.processInfos[j].name + ' </span> </div> </div> </div> <div class = "el-row" 			vc-path = "src/views/OrderManage/OperationInfo/detail.vue:45:8:el-row" 			style = "margin-top: 10px; background-color: rgba(204, 204, 255, 0.3);" > ';
									for (var k = 0; k <row.processInfos[j].processparams.length; k++) {
									strtemp += '<div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:46:9:el-col" style="padding: 2px;"> <div class = "el-row"  vc-path = "src/views/OrderManage/OperationInfo/detail.vue:48:10:el-row" 				style = "padding-left: 40px;" > 					<div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:49:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:50:12:div" 				class = "grid-content" > ' + row.processInfos[j].processparams[k].code + ': </div> </div> <div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:52:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:53:12:div" 				class = "grid-content" > ' + row.processInfos[j].processparams[k].rpvalue + ' '+ row.processInfos[j].processparams[k].parmsunit + ' </div> </div> </div> </div>';
									}
									strtemp += '</div>';
								}
								strtemp += '</section></div>';
								strtemp +='</td>';									 
								return strtemp;
							}`
							},

						],
					],
				},
				{
					tid: 'testTable.printdata23',
					title: t('message.printTemp.process'),
					field: 'printData.orderinfo.phaseViews',
					type: 'table',
					options: {
						pagebreak: true,
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: true,
					columns: [
						[
							{
								title: t('message.printTemp.process'), align: 'center', width: 800, field: 'printData.orderinfo.phaseViews.stepName',
								renderFormatter: `function (value,row,index,options){								
								if(row==null ||  Object.keys(row).length === 0 )
									return '<td></td>'; 
								var strtemp='<td style="width:550pt">'; 
								strtemp += '<div style="display: block; width: 100%;height:auto; border: 1px solid gray; border-radius: 10px; padding: 5px 10px; margin: 5px 10px;"> <section class="el-container is-vertical"> <header class="el-header" style="--el-header-height: 20px; font-size: 14px; font-weight: 700; padding: 0px;"> ';
								strtemp+='<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:233:7:el-row" style="background-color: rgba(153, 204, 255, 0.5);"><div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:234:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:235:9:div" class="grid-content">Step' + (index + 1) + ':' + row.stepName + '</div></div><div class="el-col el-col-6" vc-path="src/views/OrderManage/OperationInfo/detail.vue:237:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:238:9:div" class="grid-content">开始: ' + row.startTime + '</div></div><div class="el-col el-col-6" vc-path="src/views/OrderManage/OperationInfo/detail.vue:240:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:241:9:div" class="grid-content">结束: ' + row.endTime + '</div></div></div>';
								strtemp+=' </header>';
								for (var j = 0; j <row.processInfos.length; j++) {
									strtemp += '<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:38:8:el-row" style="font-size: 14px; font-weight: 700; padding: 0px;"> <div class = "el-col el-col-24" vc-path = "src/views/OrderManage/OperationInfo/detail.vue:39:9:el-col" > 				<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:40:10:div" 			class = "grid-content" > 				<span vc-path = "src/views/OrderManage/OperationInfo/detail.vue:41:11:span" 			style = "background-color: rgba(153, 204, 255, 0.5);" > ' + row.processInfos[j].name + ' </span> </div> </div> </div> <div class = "el-row" 			vc-path = "src/views/OrderManage/OperationInfo/detail.vue:45:8:el-row" 			style = "margin-top: 10px; background-color: rgba(204, 204, 255, 0.3);" > ';
									for (var k = 0; k <row.processInfos[j].pStepInfos.length; k++) {
										strtemp += '<div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:46:9:el-col" style="padding: 2px;"> <div class = "el-row"  vc-path = "src/views/OrderManage/OperationInfo/detail.vue:48:10:el-row" 				style = "padding-left: 40px;" > 					<div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:49:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:50:12:div" 				class = "grid-content" > ' + row.processInfos[j].pStepInfos[k].name + ': </div> </div> <div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:52:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:53:12:div" 				class = "grid-content" > ' + row.processInfos[j].pStepInfos[k].startTime + ' </div> </div> </div> </div>';
									}
									strtemp += '</div>';
								}
								strtemp += '</section></div>';
								strtemp +='</td>';							 
								return strtemp;
							}`
							},

						],
					],
				},
				{
					tid: 'testTable.printdata25',
					title: t('message.printTemp.testStyle'),
					field: 'printData.orderinfo.phaseViews',
					type: 'table',
					options: {
						pagebreak: true,
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: true,
					columns: [
						[
							{
								title: t('message.printTemp.process'), align: 'center', width: 150, field: 'printData.orderinfo.phaseViews.stepName',
								renderFormatter: `function (value,row,index,options){								
								if(row==null ||  Object.keys(row).length === 0 )
									return '<td></td>'; 
								var strtemp='<td>'; 
								strtemp += '<div style="display: block; width: 100%;height:auto; border: 1px solid gray; border-radius: 10px; padding: 5px 10px; margin: 5px 10px;"> <section class="el-container is-vertical"> <header class="el-header" style="--el-header-height: 20px; font-size: 14px; font-weight: 700; padding: 0px;"> ';
								strtemp+='<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:233:7:el-row" style="background-color: rgba(153, 204, 255, 0.5);"><div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:234:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:235:9:div" class="grid-content">Step' + (index + 1) + ':' + row.stepName + '</div></div><div class="el-col el-col-6" vc-path="src/views/OrderManage/OperationInfo/detail.vue:237:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:238:9:div" class="grid-content">开始: ' + row.startTime + '</div></div><div class="el-col el-col-6" vc-path="src/views/OrderManage/OperationInfo/detail.vue:240:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:241:9:div" class="grid-content">结束: ' + row.endTime + '</div></div></div>';
								strtemp+=' </header>';
								for (var j = 0; j <row.processInfos.length; j++) {
									strtemp += '<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:38:8:el-row" style="font-size: 14px; font-weight: 700; padding: 0px;"> <div class = "el-col el-col-24" vc-path = "src/views/OrderManage/OperationInfo/detail.vue:39:9:el-col" > 				<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:40:10:div" 			class = "grid-content" > 				<span vc-path = "src/views/OrderManage/OperationInfo/detail.vue:41:11:span" 			style = "background-color: rgba(153, 204, 255, 0.5);" > ' + row.processInfos[j].name + ' </span> </div> </div> </div> <div class = "el-row" 			vc-path = "src/views/OrderManage/OperationInfo/detail.vue:45:8:el-row" 			style = "margin-top: 10px; background-color: rgba(204, 204, 255, 0.3);" > ';
									for (var k = 0; k <row.processInfos[j].pStepInfos.length; k++) {
										strtemp += '<div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:46:9:el-col" style="padding: 2px;"> <div class = "el-row"  vc-path = "src/views/OrderManage/OperationInfo/detail.vue:48:10:el-row" 				style = "padding-left: 40px;" > 					<div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:49:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:50:12:div" 				class = "grid-content" > ' + row.processInfos[j].pStepInfos[k].name + ': </div> </div> <div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:52:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:53:12:div" 				class = "grid-content" > ' + row.processInfos[j].pStepInfos[k].startTime + ' </div> </div> </div> </div>';
									}
									strtemp += '</div>';
								}
								strtemp += '</section></div>';
								strtemp +='</td>';							 
								return strtemp;
							}`
							},

						],
					],
				},
				
				{
					tid: 'testTable.printdata27',
					title: '测试表格图表',
					field: 'printData.reportObjectTemp',
					type: 'table',
					options: {
						pagebreak: true,
					},
					editable: true,
					columnDisplayEditable: true, //列显示是否能编辑
					columnDisplayIndexEditable: true, //列顺序显示是否能编辑
					columnTitleEditable: true, //列标题是否能编辑
					columnResizable: true, //列宽是否能调整
					columnAlignEditable: true, //列对齐是否调整
					isEnableEditField: true, //编辑字段
					isEnableContextMenu: true, //开启右键菜单 默认true
					isEnableInsertRow: true, //插入行
					isEnableDeleteRow: true, //删除行
					isEnableInsertColumn: true, //插入列
					isEnableDeleteColumn: true, //删除列
					isEnableMergeCell: true, //合并单元格
					autobreak: true,
					columns: [
						[
							{
								title: 'xx', align: 'center', width: 150, field: 'printData.reportObjectTemp',
								renderFormatter: `function (value, row, index, options) {
  if (row == null || Object.keys(row).length === 0)
    return '<td></td>';
  let strtemp = '<td>';
  if (window.echarts && row) {
    if (!row) {
      strtemp += '<div style="width: 100%;height: 300px; border: 1px solid;">请先拖拽Echarts依赖</div>'
    }
    var echartDom = document.createElement("div");
    echartDom.style.width = '1000px';
    echartDom.style.height = '300px';
    var echartInstance = echarts.init(echartDom, null, { renderer: "svg" });
    var options = {
      title: { text: row.reportName, },
      tooltip: row.tooltip, legend: { data: row.legendData, },
      grid: { show: true, left: '3%', right: '10%', bottom: '3%', containLabel: true, },
      xAxis: row.xAxisData, yAxis: row.yAxisData, series: row.seriesData,
    };
    echartInstance.setOption(options);
    strtemp += echartDom.innerHTML.toString();
	console.log(echartDom.innerHTML.toString());
  }
  else {
    strtemp += '<div style="width:750px;height: 300px; border: 1px solid;">请先拖拽Echarts依赖</div>'
  }

  strtemp += '</td>';
  return strtemp;
}`
							},

						],
					],
				},
				// {
				// 	tid: 'testTable.printdata23',
				// 	title: "过程",
				// 	type: "html",
				// 	//fontWeight: 'b',
				// 	options: {
				// 		left: 0,
				// 		top: 12,
				// 		height: 200,
				// 		//xdata:['one1','one3','one4','one6','one9'],
				// 		width: 550,
				// 		autoBreak: true,
				// 		formatter: `function(t, e, printData) {
				// 		if (printData == null) {
				// 			return '<div>先预览一下，然后点击确认</div>'
				// 		}
				// 		var  strtemp = '<div style="margin:0;width:100%"><div><span style="color: blue;">|</span><span> 过程</span></div>';
				// 		for (var i = 0; i <printData.orderinfo.phaseViews.length; i++) {
				// 			strtemp += '<div style="display: block; width: 100%;height:auto; border: 1px solid gray; border-radius: 10px; padding: 5px 10px; margin: 5px 10px;"> <section class="el-container is-vertical"> <header class="el-header" style="--el-header-height: 20px; font-size: 14px; font-weight: 700; padding: 0px;"> ';
				// 			strtemp+='<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:233:7:el-row" style="background-color: rgba(153, 204, 255, 0.5);"><div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:234:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:235:9:div" class="grid-content">Step' + (i + 1) + ':' + printData.orderinfo.phaseViews[i].stepName + '</div></div><div class="el-col el-col-6" vc-path="src/views/OrderManage/OperationInfo/detail.vue:237:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:238:9:div" class="grid-content">开始: ' + printData.orderinfo.phaseViews[i].startTime + '</div></div><div class="el-col el-col-6" vc-path="src/views/OrderManage/OperationInfo/detail.vue:240:8:el-col"><div vc-path="src/views/OrderManage/OperationInfo/detail.vue:241:9:div" class="grid-content">结束: ' + printData.orderinfo.phaseViews[i].endTime + '</div></div></div>';
				// 			strtemp+=' </header>';
				// 			for (var j = 0; j <printData.orderinfo.phaseViews[i].processInfos.length; j++) {
				// 				strtemp += '<div class="el-row" vc-path="src/views/OrderManage/OperationInfo/detail.vue:38:8:el-row" style="font-size: 14px; font-weight: 700; padding: 0px;"> <div class = "el-col el-col-24" vc-path = "src/views/OrderManage/OperationInfo/detail.vue:39:9:el-col" > 				<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:40:10:div" 			class = "grid-content" > 				<span vc-path = "src/views/OrderManage/OperationInfo/detail.vue:41:11:span" 			style = "background-color: rgba(153, 204, 255, 0.5);" > ' + printData.orderinfo.phaseViews[i].processInfos[j].name + ' </span> </div> </div> </div> <div class = "el-row" 			vc-path = "src/views/OrderManage/OperationInfo/detail.vue:45:8:el-row" 			style = "margin-top: 10px; background-color: rgba(204, 204, 255, 0.3);" > ';
				// 				for (var k = 0; k <printData.orderinfo.phaseViews[i].processInfos[j].processparams.length; k++) {
				// 					strtemp += '<div class="el-col el-col-12" vc-path="src/views/OrderManage/OperationInfo/detail.vue:46:9:el-col" style="padding: 2px;"> <div class = "el-row"  vc-path = "src/views/OrderManage/OperationInfo/detail.vue:48:10:el-row" 				style = "padding-left: 40px;" > 					<div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:49:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:50:12:div" 				class = "grid-content" > ' + printData.orderinfo.phaseViews[i].processInfos[j].processparams[k].code + ': </div> </div> <div class = "el-col el-col-12" 				vc-path = "src/views/OrderManage/OperationInfo/detail.vue:52:11:el-col" > 					<div vc-path = "src/views/OrderManage/OperationInfo/detail.vue:53:12:div" 				class = "grid-content" > ' + printData.orderinfo.phaseViews[i].processInfos[j].processparams[k].name + ' </div> </div> </div> </div>';
				// 				}
				// 				strtemp += '</div>';
				// 			}
				// 			strtemp += '</section></div><div></div>';
				// 		}
				// 		return strtemp;
				// 	}`
				// 	},
				// },
			]),
		]);
	};
	return {
		addElementTypes: addElementTypes,
	};
};